@charset "UTF-8";
* {
  /* 初始化 */
  margin: 0;
  padding: 0;
}

body {
  /* 100%窗口高度 */
  height: 100vh;
  /* 弹性布局 居中 */
  display: flex;
  justify-content: center;
  align-items: center;
  /* 自定义属性，可通过var函数对其调用 */
  --c: #ff6b81;
}

svg {
  width: 200px;
  /* 相对定位 */
  position: relative;
  /* z-index: 10; */
}

#heart {
  /* 填充颜色 */
  fill: #eee;
  /* stroke属性可应用于任何种类的线条，文字和元素，就像一个圆的轮廓 */
  stroke: var(--c);
  /* 线条宽度 */
  stroke-width: 40px;
  /* 设置线条为虚线，虚线的长度 */
  stroke-dasharray: 2600;
  /* 线条的位移 */
  stroke-dashoffset: 2600;
  /* 端点为圆头 */
  stroke-linecap: round;
}

span {
  display: block;
  position: absolute;
  width: 24px;
  height: 24px;
  background-color: transparent;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  box-shadow: 0 -160px 0 var(--c), 0 160px 0 var(--c), -160px 0 0 var(--c), 160px 0 0 var(--c), -120px -120px 0 var(--c), 120px -120px 0 var(--c), 120px 120px 0 var(--c), -120px 120px 0 var(--c);
}

#checkbox:checked + svg #heart {
  -webkit-animation: drawHeart 1s linear forwards;
          animation: drawHeart 1s linear forwards;
}

#checkbox:checked ~ span {
  -webkit-animation: blink 0.5s ease-in-out forwards;
          animation: blink 0.5s ease-in-out forwards;
  -webkit-animation-delay: 0.85s;
          animation-delay: 0.85s;
}

#checkbox:checked + svg {
  -webkit-animation: beat 1s linear forwards;
          animation: beat 1s linear forwards;
}

label {
  cursor: pointer;
}

@-webkit-keyframes drawHeart {
  0% {
    stroke-dashoffset: 2600;
  }
  80% {
    fill: #eee;
    stroke-dashoffset: 0;
  }
  100% {
    fill: var(--c);
    stroke-dashoffset: 0;
  }
}

@keyframes drawHeart {
  0% {
    stroke-dashoffset: 2600;
  }
  80% {
    fill: #eee;
    stroke-dashoffset: 0;
  }
  100% {
    fill: var(--c);
    stroke-dashoffset: 0;
  }
}
@-webkit-keyframes blink {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0.8;
  }
  50% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 0;
  }
}
@keyframes blink {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0.8;
  }
  50% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 0;
  }
}
@-webkit-keyframes beat {
  0% {
    transform: scale(1);
  }
  70% {
    transform: scale(1);
  }
  80% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes beat {
  0% {
    transform: scale(1);
  }
  70% {
    transform: scale(1);
  }
  80% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}/*# sourceMappingURL=index.css.map */